import { JSEncrypt } from "jsencrypt";

// 加密公钥
const publicKey =
  "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqnkp7e262o1oH5x2WpGFcIjJbfcRTXn4/nwdZD/OU2R/WFQUbRKe4l0toiYX4VGb6Nt/Tl2wKPzb2q/m5JTd2TaHaSMqy6npFb1r33eUokkOtjMu2YjjSCxS5/JhEZ7FaifqBOpS47945yIdgUlARxNjephMsrjkdRtfwROKzmBWMq0HWjfjm3X+s+Lop5vFV+WWTgjD6dZhETiECRvn8gMfUeiLmMC/sGVlP9sob2Yuq6/T3Vbr9d0KwFNrZ2VurG5c08NUIuhhtJh3eL9euS8l1a28Jsicm5KxLjBTq3QNVMmlzTKz7BnZ2hlinnHnVhJ2CrTUh67nD5phcWdigwIDAQAB"

export default {
  // 加密
  encrypt(body) {
    const encryptor = new JSEncrypt();
    encryptor.setPublicKey(publicKey);
    return encryptor.encrypt(body);
  }
}